//
//  LBGroupFilter.mm
//  OpenGLGame
//
//  Created by Nguyen Cong Huy on 4/2/13.
//  Copyright (c) 2013 UIT. All rights reserved.
//

#include "LBGroupFilter.h"
#include "LBUtils.h"

LBGroupFilter::LBGroupFilter(){
    
    firstFilter = 0;
}

LBGroupFilter::~LBGroupFilter(){
    outputTexture = 0;
}

void LBGroupFilter::setTexture(LBTexture* texture){
    if(firstFilter != 0){
        firstFilter->setTexture(texture);
        outputTexture = firstFilter->getFinalOutputTexture();
    }
    
    if(targetFilter != 0){
        targetFilter->setTexture(outputTexture);
    }

}

void LBGroupFilter::render(){
    firstFilter->render();
    if(targetFilter != 0) targetFilter->render();
}